import java.util.EnumMap;

/**
 * @author Yuri Denison
 * @since 15.08.11
 */
public class Main {
    public enum State {
        SOLID,
        LIQUID,
        GAS
    }

    public enum Transformation {
        MELTING(State.SOLID, State.LIQUID),
        CONDENSATION(State.GAS, State.LIQUID),
        CRYSTALLIZATION(State.LIQUID, State.SOLID),
        SUBLIMATION(State.SOLID, State.GAS),
        EVAPORATION(State.LIQUID, State.GAS);

        private State s1;
        private State s2;

        Transformation(State s1, State s2) {
            this.s1 = s1;
            this.s2 = s2;
        }
    }

    private static EnumMap<State, EnumMap<State, Transformation>> transformationMap;

    static {
        transformationMap = new EnumMap<State, EnumMap<State, Transformation>>(State.class);
        for (Transformation t: Transformation.values()) {
            if (transformationMap.get(t.s1) == null) {
                transformationMap.put(t.s1, new EnumMap<State, Transformation>(State.class));
            }
            transformationMap.get(t.s1).put(t.s2, t);
        }

    }

    public static Transformation getTransformation(State s1, State s2) {
        return transformationMap.get(s1).get(s2);
    }

    public static void main(String[] args) {
        new Transformations().showForm();
    }
}
